<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>店铺列表｜用户绑定店铺</title>
<body class="withvernav">
<div class="bodywrapper">
   {{include file='/public/leftmenu.tpl'}}
        
    <div class="centercontent tables">
    
        <div class="pageheader notab">
            <h1 class="pagetitle">店铺列表</h1>
            <span class="pagedesc">店铺绑定主要负责人（订单或者SKU有问题处理人），只可绑定一次，绑定之后需要修改请联系管理员修改<br>主负责人绑定店铺之后，可以添加删除店铺管理人员</span>
            
        </div><!--pageheader-->
        
        <div id="contentwrapper" class="contentwrapper">
        <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
          <!--搜索栏-->
    <form class="stdform stdform2" method="get" action="/user/Bindingshops">
      <div class="tableoptions"> 
       请选择平台:   <select name="platformID" class="selection" style="width:100px;">
                            <option value="" {{if $status==""}} selected{{/if}}>请选择</option>
                            {{foreach from=$platform item=li key=_key}}
                            <option value="{{$li.id}}" {{if $li.id==$platformID}} selected{{/if}}>{{$li.name}}</option>
                            {{/foreach}}
                        </select>
       其他搜索: <input type="text" name="other" id="other" class="width100" value="{{$other}}" />
       
        <button class="btn btn_orange btn_search radius50">Search</button>
        
      </div>
    </form>
    <!--搜索栏结束-->
                <table cellpadding="0" cellspacing="0" border="0" class="stdtable">
                    <colgroup>
                    	 <col class="con1" />
                        <col class="con0" />
                        <col class="con1" />
                        <col class="con0" />
                        <col class="con1" />
                        <col class="con0" />
                    </colgroup>
                   
                    <thead>
                        <tr>
                            <th class="head0">店铺名称</th>
                            <th class="head1">对应平台</th>
                            <th class="head0" colspan="2">主负责人</th>
                             
                               
                           
                           
                          
                        </tr>
                    </thead>
                  
                    <tbody>
                    {{foreach from=$list item=li key=key}}
                        <tr>
                            <td>{{$li.name}}</td>
                            <td>{{$li.platfromname}}</td>
                            <td class="center">{{if $li.updateoper}}{{$li.updateoper}}{{else}}
                            	 <form id="form{{$li.id}}" class="stdform stdform2" method="post" action="/user/Bindingshops" onSubmit="return false">                                 <input type="hidden" id="id" name="shopid" value="{{$li.id}}">
                                  <input type="text" name="updateoper" id="updateoper{{$li.id}}" class="width100" value="" />
                               <button onClick="getUser({{$li.id}})" id="btn" class="stdbtn btn_orange">确定</button>
                                 </form>
                            {{/if}}</td>
                            {{if $li.updateoper}}
                             <td class="center">
                            添加其他店铺管理人员（多个管理人员逗号隔开姓名 如：张三,李四）：
                             <form id="formother{{$li.id}}" class="stdform stdform2" method="post" action="/user/Bindingshops" onSubmit="return false">                                 <input type="hidden" id="id" name="shopid" value="{{$li.id}}">
                               <input type="hidden" id="type" name="type" value="1">
                                  <input type="text" name="updateoper" id="Otherupdateoper{{$li.id}}" class="width400" value="{{$li.otherUpload}}" />
                               <button onClick="getOtherUser({{$li.id}})" id="btn" class="stdbtn btn_orange">确定</button>
                                 </form>
                            </td>
                             {{/if}}

                        </tr>
                      {{/foreach}}
                       
                    </tbody>
                </table>
                  <div class="page">{{$pageList}} 计{{$total}}条记录，共{{$totalpage}}页</div>
                <br /><br />
                
               </div>
    
</div><!--bodywrapper-->







<script language="javascript">












	function getUser(id)
	{
		var updateoper = $("#updateoper"+id).val();
		if(!updateoper)
		{
			alert("请输入负责人名称！");
			return false;		
		}
		$.post("/user/ajaxbutton", {"op":"getusername","updateoper":updateoper},
	 	 function(data){
		if(data==201)
		{
			$('#form'+id).submit();
			
		}else{
			alert("填写的名称不正确！请重新填写");
			return false;
		}
				
	   },"json");
	}
	
	function getOtherUser(id)
	{
		var updateoper = $("#Otherupdateoper"+id).val();
		if(!updateoper)
		{
			//alert("请输入负责人姓名！");
			//return false;		
		}
		
		$('#formother'+id).submit();
			
	
			
	}
</script>
</body>
</html>
